package com.yanqu.road.server.cmd.activity.qixi;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.QixiProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.activity.QixiCrossMgr.CrossQixiMgr;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.GameProtocol;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = CrossProtocol.C_QIXI_GET_FLOWER_BROADCAST_REWARD, desc = "七夕活动 领取广播奖励")
public class CrossGetBroadcastRewardCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        QixiProto.CrossGetBroadcastRewardReqMsg reqMsg = QixiProto.CrossGetBroadcastRewardReqMsg.parseFrom(packet.getBytes());
        QixiProto.CrossGetBroadcastRewardRespMsg.Builder respMsg = CrossQixiMgr.getBroadcastReward(reqMsg.getActivityId(), reqMsg.getBroadcastId());
        MessageHelper.sendPacket(serverId, packet.getPlayerId(),
                YanQuMessageUtils.buildMessage(GameProtocol.S_QIXI_RECEIVE_BROADCAST_REWARD_CROSS_BACK, respMsg));
    }

    @Override
    public void sendData() {

    }
}
